package io.github.cocoa.module.socket.convert.sample;

import io.github.cocoa.framework.common.pojo.PageResult;
import io.github.cocoa.module.socket.api.sample.dto.SampleInfoRespDTO;
import io.github.cocoa.module.socket.controller.admin.sample.vo.*;
import io.github.cocoa.module.socket.dal.dataobject.sample.SampleInfoDO;
import org.mapstruct.Mapper;
import org.mapstruct.Mapping;
import org.mapstruct.factory.Mappers;

import java.util.List;

/**
 * 示例信息 Convert
 *
 * @author James
 */
@Mapper
public interface SampleInfoConvert {

    SampleInfoConvert INSTANCE = Mappers.getMapper(SampleInfoConvert.class);

    @Mapping(target = "id", ignore = true)
    SampleInfoDO convert(SampleInfoCreateReqVO bean);

    SampleInfoDO convert(SampleInfoUpdateReqVO bean);

    SampleInfoDO convert(SampleInfoImportExcelVO bean);

    SampleInfoRespVO convert(SampleInfoDO bean);

    SampleInfoRespDTO convertDTO(SampleInfoDO bean);

    List<SampleInfoRespVO> convertList(List<SampleInfoDO> list);

    List<SampleInfoExcelVO> convertListExcel(List<SampleInfoDO> list);

    PageResult<SampleInfoRespVO> convertPage(PageResult<SampleInfoDO> page);

}
